var nav = document.querySelectorAll(".nav>ul>li");
var section = document.querySelectorAll(".section>div");
nav.forEach(function(xb , el){
    el.xb = xb;
    el.click(function(){
        if ( section.eq(this.xb).css('display') == 'none' ){
            section.eq(this.xb).show(1000);
        }else{
            section.eq(this.xb).hide(1000);
        }
    })
})